Date: Wed, 11 Dec 1996 22:33:07 GMT
Server: NCSA/1.5
Content-type: text/html
Last-modified: Wed, 11 Sep 1996 03:00:46 GMT
Content-length: 1645

<HTML>

<HEAD>
<TITLE>CS 302 Section 70 - Program 0</TITLE>
</HEAD>

<BODY>

<H2><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><A HREF="http://www.cs.wisc.edu/~tick/cs302.html#assignments" ><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><IMG SRC="http://www.cs.wisc.edu/~tick/icons/arrowleft.gif" WIDTH=15 HEIGHT=15></A> Program0</H2>

<HR>

Program0 requires you to do no programming of your own, nor are you required at this point to understand what the program is doing (although it may make a little more sense once you run it). It's simply intended to get you used to using the PC's, MS-DOS, and Microsoft Fortran.
<p>
First, if you haven't already, check out <!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><A href="http://www.cs.wisc.edu/~tick/cs302/Short.html">the basics of using Fortran on the PC's</A>. Second, you're going to need once additional piece of information: the file prog0.dat (that's prog zero) which program0 needs in the same directory that you run your program in.

Here is the program to type in:
<PRE>
C       Jeff Lampert
C       9/5/96
C       Program 0
C       CS302, Section 70

        PROGRAM ZERO
        IMPLICIT NONE
        CHARACTER NAME*128
        CHARACTER BUFFER*20

        OPEN (UNIT = 1, FILE = 'PROG0.DAT' , STATUS = 'OLD')  

        PRINT *,'Please enter your name: '
        READ '(A)',NAME

2       CONTINUE

           READ(1,4,END=3) BUFFER
4          FORMAT(A)
           PRINT *,BUFFER 
        GOTO 2

3       CONTINUE

        PRINT *, NAME
        CLOSE(UNIT=1)
        STOP
        END
</PRE>
</BODY>
<HR>

<ADDRESS>
<H5>Copyright &copy 1996 <!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><A HREF="http://www.cs.wisc.edu/~tick/tick.html">Jeff Lampert</A> (<!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><A HREF="mailto:tick@cs.wisc.edu">tick@cs.wisc.edu</A>).  Last modified September 5, 1996.</H5>
</ADDRESS>

</HTML>

